// Decompiled by DJ v3.7.7.81 Copyright 2004 Atanas Neshkov  Date: 2007-9-15 18:54:06

// Decompiler options: packimports(3) fieldsfirst ansi 
// Source File Name:   nc.java

package com.zelix;

import java.io.*;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;

// Referenced classes of package com.zelix:
//            hc, sx, w6

public final class nc
{

    int a;
    File b;
    ZipFile c;
    String d;
    ZipEntry e;
    String f;
    hc g;
    public static int h;
    private static String z[];

    public nc(File file)
    {
        b = file;
        a = 1;
        f = file.getAbsolutePath();
    }

    public nc(String s)
    {
        b = new File(s);
        a = 1;
        f = b.getAbsolutePath();
    }

    public nc(ZipFile zipfile, ZipEntry zipentry)
    {
        this(zipfile, zipentry, null);
    }

    public nc(ZipFile zipfile, ZipEntry zipentry, hc hc1)
    {
        c = zipfile;
        d = zipfile.getName();
        e = zipentry;
        a = 2;
        f = zipentry.getName();
        g = hc1;
    }

    public String a()
    {
        if(c != null)
            return c.getName();
        else
            return null;
    }

    public String b()
    {
        if(g != null)
            return g.f();
        else
            return a();
    }

    public File c()
    {
        switch(a)
        {
        case 1: // '\001'
            if(b == null)
                b = new File(f);
            return b;

        case 2: // '\002'
            return null;
        }
        throw new RuntimeException(z[0] + a + z[1] + getClass().getName());
    }

    public InputStream a(sx sx1)
        throws IOException
    {
        switch(a)
        {
        case 1: // '\001'
            FileInputStream fileinputstream = new FileInputStream(f);
            if(sx1 != null)
                sx1.a(fileinputstream.available());
            return fileinputstream;

        case 2: // '\002'
            if(c == null)
                c = new w6(d);
            if(e == null)
                e = c.getEntry(f);
            InputStream inputstream = c.getInputStream(e);
            if(sx1 != null)
                sx1.a((int)e.getSize());
            return inputstream;
        }
        throw new RuntimeException(z[0] + a + z[1] + getClass().getName());
    }

    public String d()
    {
        return f;
    }

    public hc e()
    {
        return g;
    }

    public boolean f()
    {
        switch(a)
        {
        case 1: // '\001'
            return true;

        case 2: // '\002'
            return false;
        }
        throw new RuntimeException(z[0] + a + z[1] + getClass().getName());
    }

    public void g()
    {
        b = null;
        e = null;
        if(c != null)
        {
            try
            {
                c.close();
            }
            catch(IOException ioexception) { }
            c = null;
        }
    }

    public String toString()
    {
        return d();
    }

    private static String z(char[] chs) {
        byte key = 0;
        for (int i = 0; i < chs.length; i++) {
            switch (i % 5) {
                case 0:
                    key =0x57;
                    break;
                case 1:
                    key =59;
                    break;
                case 2:
                    key =19;
                    break;
                case 3:
                    key =110;
                    break;
                case 4:
                    key =35;
                    break;
            }
            chs[i] ^= key;
        }
        return new String(chs).intern();
    }

    static
    {
        String as[];
        as = new String[2];
        as[0] = z("\025ZwNW.KvS".toCharArray());
        as[1] = z("wR}N".toCharArray());
        z = as;
    }
}